package br.fesppr.sacob.report;

import br.fesppr.sacob.util.Util;
import java.io.InputStream;
import java.sql.Connection;

import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.view.JasperViewer;

public class SacobReport {

    public void exibeReport() {

        try {

            Connection conn = Util.getSacobConnection();

            String report = "/sacob_listagem.jasper";

            InputStream is = this.getClass().getResourceAsStream(report);

            JasperPrint print = JasperFillManager.fillReport(is, null, conn);

            JasperViewer.viewReport(print, false);

        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}
